<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(item, index) in nameList">
            {{index}}--{{item}}
        </li>
    </ul>
</div>
<!--引入vue文件-->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
    const vm = Vue.createApp({
        data() {
            return {
                nameList: ["洗衣机", "上海", "5800元"]
            }
        }
    }).mount('#app');
    vm.nameList[3] = "1800台";
    // 使用数组原型的splice()方法
    vm.nameList.splice(0, 0, "畅销版");

</script>
</body>
</html>
